//统一管理项目用户相关的接口
import request from '@/utils/request'
import type { loginFormData, loginResponseData, userInfoResponseData } from './type'
// 项目用户相关的请求地址
enum API {
  LOGIN_URL = "http://114.115.179.162:8022/prod-api/admin/acl/index/login",
  LOGOUT_URL = "http://114.115.179.162:8022/prod-api/admin/acl/index/logout",
  USERINFO_URL = "http://114.115.179.162:8022/prod-api/admin/acl/index/info",
}

// 登录接口
// 泛型第二个参数是约束返回数据的类型
export const reqLogin = (data: loginFormData) => request.post<any, loginResponseData>(API.LOGIN_URL, data)
// 获取用户信息
export const reqUserInfo = () => request.get<any, userInfoResponseData>(API.USERINFO_URL)
// 登出接口
export const reqLogout = () => request.post<any,any>(API.LOGOUT_URL)